﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using XGameFrame;
using XGameFrame.Controls;

namespace XTowerDef.GameScreens.StartMenuScreenElements
{
    public class MouseCoords:Label
    {
        
        public MouseCoords(Vector2 pPosition,String pText)
            :base(pPosition,pText)
        {
            Size = getSizeForText(Text);
            Bounds = new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y);
            //UpdateBoundPositions();
        }

        public override void Update(GameTime gameTime)
        {
            Text = String.Format("X: {0}\nY: {1}", InputHandler.CurrentMouseState.X, InputHandler.CurrentMouseState.Y);
            Size = getSizeForText(Text);
            Bounds = new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y);
            base.Update(gameTime);
        }

        public void ChangeVisibility()
        {
            this.Visible = !this.Visible;
            
        }
    }
}
